package com.springmvc.controller;

import com.example.springmvc.mapper.Usermapper;
import com.example.springmvc.pojo.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController

public class Usercontroller {
    @Resource
    Usermapper usermapper;
    @PostMapping("/login")
    public User login(@RequestBody User user){
        User dbuser = usermapper.getuserbyusernameandpassword(user.getUsername(),user.getPassword());
        return dbuser;
    }
}
